<template>
  <el-row class="menupage">
    <el-col>
      <el-menu
        class="el-menu-vertical-demo"
        background-color="#4682B4"
        text-color="#fff"
        active-text-color="#409eff"
      >
        <router-link to="home" key="home">
          <el-menu-item  index="home">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-home"></use>
            </svg>
            <span slot="title">首页</span>
          </el-menu-item>
        </router-link>
        <template v-for="item in items">
          <el-submenu v-if="item.children" :index="item.path" :key="item.path">
            <template slot="title">
              <svg class="icon" aria-hidden="true">
                <use :href="item.icon"></use>
              </svg>
              <span slot="title">{{ item.name }}</span>
            </template>
            <router-link
              v-for="citem in item.children"
              :to="citem.path"
              :key="citem.path"
            >
              <el-menu-item :index="citem.path">
                <span slot="title">{{ citem.name }}</span>
              </el-menu-item>
            </router-link>
          </el-submenu>
        </template>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "LeftMenu",
  data() {
    return {
      items: [
        {
          icon: "#icon-bars",
          name: "资金管理",
          path: "found",
          children: [{ path: "fundlist", name: "资金流水" }],
        },
        {
          icon: "#icon-about",
          name: "信息管理",
          path: "info",
          children: [{ path: "infoshow", name: "个人信息" }],
        },
      ],
    };
  },
};
</script>

<style scoped>
@import url("../../node_modules/element-ui/lib/theme-chalk/index.css");
* {
  vertical-align: baseline;
}
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
.menupage {
  position: fixed;
  top: 68px;
  left: 0;
  min-height: 100%;
  background-color: steelblue;
}
.leftmenu {
  min-height: 100%;
}
.el-menu {
  border: none;
  min-height: 100%;
}
.fa-margin {
  margin-right: 5px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 150px;
  min-height: 100%;
}
.el-menu-vertical-demo {
  width: 150px;
  min-height: 100%;
}
.el-submenu .el-menu-item {
  min-width: 150px;
}

.hiddenDropdown,
.hiddenDropname {
  display: none;
}
a {
  text-decoration: none;
}
span {
  font-size: 14px;
  margin-left: 5px;
}
</style>